package com.study.spmongodb.book.wwj.char16;

/**
 * @author MI
 * @version 1.0
 * @date 2020/11/28 13:23
 */
public class FilghtSecurity {
    private int count = 0;

    //登机牌
    private String boardingPass = "null";

    //身份证
    private String idCard = "null";

    public void pass(String boardingPass, String idCard) {
        this.boardingPass = boardingPass;
        this.idCard = idCard;
        this.count++;
        check();

    }

    private void check() {

        if (boardingPass.charAt(0) != idCard.charAt(0)) {
            throw new RuntimeException("====Exception==" + toString());
        }

    }

    @Override
    public String toString() {
        return "FilghtSecurity{" +
                "count=" + count +
                ", boardingPass='" + boardingPass + '\'' +
                ", idCard='" + idCard + '\'' +
                '}';
    }
}
